import {memo,forwardRef,useRef, useImperativeHandle} from 'react';

const MemoSon =memo(forwardRef(function Son(props,ref){
    console.log('son')
    const refson = useRef(null)
    const handleClick = () => {
         ref.current.focus()
    }
    useImperativeHandle(ref,()=>{
        return {
            focus:handleClick,
        }
    })
    return <div>
           
              <input type='text' ref={ref}></input>
              <input type='text' ref={refson}></input>
            </div>;
}))

export default MemoSon;